package com.kmair.caiwu.financialexpress.service.impl;

import com.kmair.caiwu.financialexpress.dao.ProductionMapper;
import com.kmair.caiwu.financialexpress.pojo.Production;
import com.kmair.caiwu.financialexpress.service.DataOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ProductionService implements DataOperationService {
    final ProductionMapper dao;

    @Autowired
    public ProductionService(ProductionMapper dao) {
        this.dao = dao;
    }

    @Override
    public int deleteByPrimaryKey(Integer tId) {
        return dao.deleteByPrimaryKey(tId);
    }

    @Override
    public int insert(Object record) {
        return dao.insert((Production) record);
    }

    @Override
    public int insertSelective(Object record) {
        return dao.insertSelective((Production) record);
    }

    @Override
    public Production selectByPrimaryKey(Integer tId) {
        return dao.selectByPrimaryKey(tId);
    }

    @Transactional(propagation = Propagation.SUPPORTS)
    public List<Production> selectBySelective(Integer tId, String queryData) {
        return dao.selectBySelective(tId, queryData);
    }

    @Override
    public int updateByPrimaryKeySelective(Object record) {
        return dao.updateByPrimaryKeySelective((Production) record);
    }

    @Override
    public int updateByPrimaryKey(Object record) {
        return dao.updateByPrimaryKey((Production) record);
    }

    @Override
    public List selectSelective(Object entity) {
        return null;
    }
}
